﻿#ifndef MOVESTAGE_H
#define MOVESTAGE_H
#include <string>
#include <QSerialPort>
#include <QSerialPortInfo>
#include<iostream>

class MoveStage
{
public:
  MoveStage(QString port_name);
public:


  QString findDevice();
  bool testDevice();
  bool connectDevice();
  QString GetPortName();
  void SetPortName(QString port_name);
  bool IsSerialOpen();
  void CloseSerial();
  bool OpenSerial();
  void setReadBufferSize(qint64 m_nReadBuffSize);
  bool isConnect();
  /*FUN*/
  bool setLR(unsigned int data_int);
  bool setSpeed(unsigned int data_int);
  bool setDistance(unsigned int data_int);
  bool lanchGo();
  QSerialPort* serial;
private:

  QString _port_name;
  bool writeCmd(char key, unsigned int data_int);


};

#endif // MOVESTAGE_H
